home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Grab(input,output,picfile);
-
- { Copyright (c) 1987, Ciarcia's Circuit Cellar }
- { All Rights Reserved }
-
- {$U- control-break checking during execution }
- {$C- control-break checking during I/O operations }
- {$R- array range checking }
-
- {$Ideclares.p declarations }
- {$Ihexutil.p hex utilities }
- {$Iserial.p serial interface code }
- {$Ipictures.p picture file code }
- {$Iimages.p image processing }
-
- VAR
- manual : BOOLEAN; { FALSE when in auto }
-
- BEGIN
-
- LowVideo;
-
- IF (ParamStr(2) = '/n') OR (ParamStr(3) = '/n')
- THEN manual := FALSE
- ELSE manual := TRUE;
-
- ComOn(bitsec); { set up serial port }
-
- Port[comMCR] := $03; { PC <-> trans serial }
- { camera -> monitor }
- IF manual
- THEN BEGIN
- Write('Press Enter to grab an image... ');
- Readln;
- END;
-
- pic1 := NIL; { ensure new alloc }
- PicSetup(pic1); { set up picture array }
-
- Writeln('Loading');
- GetPicture(pic1,fullres); { get the byte }
-
- IF manual
- THEN BEGIN
- Write('Press Enter to display it...');
- Readln;
- SendPicture(pic1); { show on screen }
- END;
-
-
- IF (ParamStr(2) = '/c') OR (ParamStr(3) = '/c')
- THEN BEGIN
- pic2 := pic1; { use compressed image }
- Writeln('Saving compressed image');
- END
- ELSE BEGIN
- pic2 := NIL; { ensure new alloc }
- PicSetup(pic2); { get second array }
- Writeln('Expanding');
- Expand(pic1,pic2); { expand image }
- END;
-
- filespec := GetFSpec(ParamStr(1));
- SavePicture(filespec,pic2); { save it away }
-
- END.